package com.wyzz.hr.util.excel;

import java.io.File;
import java.util.ArrayList;
import java.util.List;
import jxl.*;

public class ReadNormalExcel extends IReadExcel {

	public ReadNormalExcel(File inputFile) {
		setInputFile(inputFile);
	}

	public List readContent() throws Exception {
		Sheet sheet = workbook.getSheet(0);
		int colNum = sheet.getColumns();
		int rowNum = sheet.getRows();
		if (colNum == 0 || rowNum == 0)
			return null;
		List result = new ArrayList();
		for (int i = 0; i < colNum; i++) {
			String col[] = new String[rowNum];
			for (int j = 0; j < rowNum; j++)
				col[j] = sheet.getCell(i, j).getContents();

			result.add(col);
		}

		return result;
	}
}
